<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c"uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<link title=style href="style.css" type=text/css rel=StyleSheet>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Insert title here</title>
	</head>
	<body>
		<h2>받은 쪽지함</h2>
	<br>
	<table border="1"cellspacing="0" width="700">
		<tr>
			<th id="number" style="width:100px;">보낸이</th>
			<th id="title" style="width:550px;">제목</th>
			<th id="date" style="width:150px;">작성일</th>
		</tr>
		<c:choose>
		<c:when test="${requestScope.lto.list!=null }">
			<c:forEach items="${requestScope.lto.list }"var="list">
				<tr>
					<td headers="number" align="center">${list.messageWriter }</td>
					<td headers="title">
					<a href="message.do?method=linkController&no=${list.messageNo }&page=${requestScope.lto.pto.currentPage}&id=client">${list.messageTitle }</a></td>
					<td headers="date" align="center">${list.messageWritedate }</td>
				</tr>
			</c:forEach>
		</c:when>
		<c:otherwise>
			<tr>
				<td colspan="3" align="center"> 받은 쪽지가 없습니다. </td>
			</tr>
		</c:otherwise>
		</c:choose>
	</table>
	<div align="center" style="width:700px;">
	
		<c:choose>
			<c:when test="${requestScope.lto.pto.previousPageGroup}">
				<a href="message.do?method=ClientListController&page=${requestScope.lto.pto.startPageOfPageGroup-1 }">◀</a>
			</c:when>
			<c:otherwise>
				◀
			</c:otherwise>
		</c:choose>
		<c:forEach begin="${requestScope.lto.pto.startPageOfPageGroup }"end="${requestScope.lto.pto.endPageOfPageGroup }"var="i">
			<c:choose>
			<c:when test="${requestScope.lto.pto.currentPage==i }">
				<font color="red">${i }</font>
			</c:when>
			<c:otherwise>
			<a href="message.do?method=ClientListController&page=${i}">${i }</a>
			</c:otherwise>
			</c:choose>
		</c:forEach>
		<c:choose>
			<c:when test="${requestScope.lto.pto.nextPageGroup }">
			<a href="message.do?method=ClientListController&page=${requestScope.lto.pto.endPageOfPageGroup+1 }">▶</a>
			</c:when>
			<c:otherwise>
				▶
			</c:otherwise>
		</c:choose>
	</div>
	<a href="message.do?method=ClientReplyController">보낸 쪽지함</a>
	<a href="message.do?method=writeMessage">쪽지쓰기</a>
	</body>
</html>